public class delDupNode {
    //删除重复节点
    public ListNode deleteDuplicates(ListNode head) {
        if(head==null||head.next==null){
            return head;
        }
        ListNode cur = head;
        ListNode curNext = head.next;
        while(curNext!=null){
            if(cur.val!=curNext.val){
                cur.next = curNext;
                cur = cur.next;
            }
            curNext = curNext.next;
        }
        cur.next = null;
        return head;
    }
}
